//
//  WBBaseTableViewController.swift
//  sinaWeibo
//
//  Created by 吴熠 on 16/11/13.
//  Copyright © 2016年 吴熠. All rights reserved.
//

import UIKit

let kScreenW = UIScreen.main.bounds.width
let kScreenH = UIScreen.main.bounds.height
//遵守协议
class WBBaseTableViewController: UITableViewController,WBVisitorLoginRegisterDelegate {
    
    var userLogin = WBUserAccountViewModel.shared.userLogin
    
    lazy var visitorView : WBVisitorView = WBVisitorView()
    
    
    override func loadView() {
        if userLogin==true {
            //准备自身tableView
            super.loadView()
        }else{
            self.view = visitorView
            //设置代理
            visitorView.delegate = self
            
        }

    }
    //实现代理方法
    func userWillLogin() {
        print("点击了登录按钮")
        let oauth = WBOAuthViewController()
        let nav = UINavigationController(rootViewController: oauth)
        self.present(nav, animated: true, completion: nil)
    }
    
    func userWillRegister() {
        print("点击了注册按钮")
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        
    }

}
